home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / fido / CrashMail125.lha / CrashMail / rexx / DescAdder.rexx < prev    next >
OS/2 REXX Batch file  |  1996-09-11  |  2KB  |  87 lines

  1. /*  DescAdder v1.1;  To be used together with CrashAnnounce
  2.     (c) 1996  Fredrik Bennison (lomaxx@dalnet.se, 2:205/324)
  3.  
  4.     $VER: DescAdder 1.1 (19.04.96)
  5.  
  6.     This ARexx-script takes the outfile created by CrashAnnounce and adds
  7.     descriptions to the new echo-areas.
  8.  
  9.     Syntax:  rx DescAdder <infile> <outfile> <forward> [forward ...]
  10.  
  11.                                                     */
  12.  
  13. IF ~SHOW(Libraries,'rexxsupport.library') THEN
  14.    IF ~ADDLIB("rexxsupport.library",0,-30,0) THEN EXIT
  15.  
  16. parse arg infile ' ' outfile ' ' fwdfile
  17.  
  18. f = 1
  19. slask = ''
  20.  
  21. do until slask = ''
  22.    parse var fwdfile fwd.f ' ' slask
  23.    f = f+1
  24.    fwdfile = slask
  25. end
  26.  
  27. f = f-1
  28.  
  29. do i = 1 to f
  30.    ffile.i = 'ffile' || i
  31. end
  32.  
  33. call open('ifile', infile, 'R')
  34. call open('ofile', outfile, 'W')
  35.  
  36. do i = 1 to f
  37.    call open(ffile.i, fwd.i, 'R')
  38. end
  39.  
  40. do a = 1 to 3
  41.    str = readln('ifile')
  42.    writeln('ofile', str)
  43. end
  44.  
  45. do while ~eof('ifile')
  46.    found = false
  47.    str = readln('ifile')
  48.    str = strip(str, 'T')
  49.    if length(str) = 0 then
  50.       break
  51.    do i = 1 to f
  52.       descstr = readln(ffile.i)
  53.       do while ~eof(ffile.i)
  54.          if index(descstr, str)=0 then
  55.             descstr = readln(ffile.i)
  56.          else do
  57.             parse var descstr str ' ' desc
  58.             writeln('ofile', str)
  59.             writeln('ofile', '   - ' || desc)
  60.             do j = 1 to f
  61.                seek(ffile.j,0,'B')
  62.             end
  63.             found = true
  64.          end
  65.          if found = true then
  66.             break
  67.       end
  68.       if found = true then
  69.          break
  70.    end
  71.    if found = false then do
  72.       writeln('ofile', str)
  73.       writeln('ofile', '   - <No description>')
  74.       do j = 1 to f
  75.          seek(ffile.j,0,'B')
  76.       end
  77.    end
  78. end
  79.  
  80. call close('ifile')
  81. call close('ofile')
  82.  
  83. do i = 1 to f
  84.    call close(ffile.i)
  85. end
  86.  
  87.